<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<!--只在模块名下面有效 -->
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>集团管理</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<div class="searchArea">
				<form id="searchBar">
					<div class="fieldset1 clearFix">
						<div class="fieldBox">
							<div class="label" style="width: 60px;">企业名称</div>
							<div class="field">
								<input name="dataName" id="dataName" type="text" class="ui-textbox" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label" style="width: 80px;">属性</div>
							<div class="field">
								<input name="attrCd" id="attrCd" type="text" class="ui-textbox" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label">区域</div>
							<div class="field">
								<div class="field">
									<jsp:include page="../../system/sysRegion/region.jsp" flush="true" >
										<jsp:param name="regionShowLvl" value="2"/>
									</jsp:include>
								</div>
							</div>
						</div>
						<div  class="fieldBox">
							<div class="label">协议有效状态</div>
							<div class = "field">
								<select name="dataType" id="dataType" data-value=" ">
									<option value="1" seleted>供应商</option>
									<option value="2">挂靠公司</option>
								</select>
							</div>
						</div>
						<div class="clearFix"></div>
						<div class="btnsBox">
							<span id="searchBtn" class="sq-button sq-button-round">查询</span>
						</div>
					</div>
				</form>
			</div>
			<div id="ligergridDB" class="sq-grid"></div>
		</div>
	</div>
</body>
	<script type="text/javascript">
	var gridDB = null;
	var grid = null ;
	var form = null ;
	$(function () {
		gridDB = $("#ligergridDB").ligerGrid({
            url: '<%=path%>/product/splApplyInfo/deadStartFlowList.do',
            method : 'post',
            //contentType:'application/json',
            columns: [
                { display: '企业名称', name: 'dataName', minWidth: 10 ,align:'left', enabledSort:false},
                { display: '属性', name: 'attrCdNm', minWidth: 50 ,align:'left', enabledSort:false},
                { display: '统一社会信用代码/证件号', name: 'succ', minWidth: 50 ,align:'left', enabledSort:false}, 
                { display: '审核状态', name: 'audStsCdNm', minWidth: 50 ,align:'left', enabledSort:false}, 
                { display: '操作', name: 'num', minWidth: 50 ,align:'left', enabledSort:false,
                	render: function (rowdata, rowindex, value){
         	    	   var m="";
                        m+='<a class="sq-button-hasicon" href="javascript:addFlowStart(';
                        m+="'"+rowdata.dataId+"',";
                        m+="'"+rowdata.dataType+"',";
                        if(rowdata.dataType == 1){
                        	m+="'"+rowdata.splId+"'";
                        }else{
                        	m+="'"+rowdata.prjLnkCompId+"'";
                        }
                        m+=')"><i class="sqBtnIco_1"></i>发起审核</a>';
                        
                        return m ;
                	}
                }, 
            ],
            pageSize:10,
            pageSizeOptions: [10, 20, 30, 40, 50, 100],//按照自己的喜好选择不同的页面显示条数
            root:'rows',
            record:'total',
            hideLoadButton : true,
            width: '100%',
            height:'100%',
            heightDiff:-30,
            checkbox:true,
            rownumbers:true,
            fixedCellHeight: false,
            pageParmName:'page',
            pagesizeParmName:'pageSize',
            /* onLoaded: function(grid) {
	            grid.data[grid.options.record] = 9100 // 劫持数据，改变数据
	            grid.toggleLoading(false); // 关闭Loading加载动画
	    }, */
        });
		gridDB.setHeight(100);
		grid = liger.get("ligergridDB");
		form = $("#searchBar").ligerForm();
		
		
		$("#searchBtn").click(function(event) {
			var form = new liger.get("searchBar");
            var data = form.getData();
            console.log(JSON.stringify(data));
            for (name in data){
                grid.setParm(name,data[name]);
            };
	        gridDB.reload();
	    });
	
});
	function addFlowStart(id,dataType,dataId){
		if(!dataType){
			return ;
		}
		var url = '';
		if(dataType == 1){
			url = '<%=path%>/product/splApplyInfo/againAddFlowStart.do?applyId='+id+'&splId='+dataId ;
		}else{
			url = '<%=path%>/project/prjLnkCompApply/againAddLnkCompApplyFlow.do?applyId='+id+'&lnkId='+dataId ;
		}
		 $.ajax({
        	 type: 'post',
             dataType: 'json',
             data: {applyId:id,splId:dataId},
             url: url,
             beforeSend: function () {
                 wait_dialog = $.ligerDialog.SQalert({
                     content: LogUtils.LOG_CMM_DATA_LOADING,
                     SQ_type: "waitting"
                 });
             },
             success: function (msg) {
                 wait_dialog.close();
                 if (msg.success == 1) {
                     $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                     gridDB.reload();
                 } else {
                     $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                 }
             }
        })
	}
</script>


</html>
